﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WinCourseControls
{
    public partial class FrmTextBox : Form
    {
        public FrmTextBox()
        {
            InitializeComponent();
        }

        private void lblCommit_Click(object sender, EventArgs e)
        {
            string userName = txtUserName.Text.Trim();
            string userPwd = txtPwd.Text.Trim();
            string age = txtAge.Text.Trim();
            txtRemark.AppendText(userName + " " + userPwd + "   " + age);
            txtAge.Clear();
        }

        private void txtUserName_TextChanged(object sender, EventArgs e)
        {
            string userName = txtUserName.Text.Trim();
            string userPwd = txtPwd.Text.Trim();
            string age = txtAge.Text.Trim();
            txtRemark.AppendText( userName + " " + userPwd + "   " + age);
        }

        private void txtUserName_Click(object sender, EventArgs e)
        {
            if(txtUserName.Enabled&&txtUserName.ReadOnly==false)
            {
                MessageBox.Show("当前可编辑，你可以修改用户名！");
            }
            else
            {
                MessageBox.Show("当前不可编辑，你不能修改用户名！");
            }
        }
    }
}
